#ifndef CONTINUOUSSEQUENCER_H
#define CONTINUOUSSEQUENCER_H

#include <QObject>
#include "MutaGraphicsView.h"
#include "MutaScene.h"
#include "Global.h"
#include "MutaCursor.h"
#include <QElapsedTimer>
#include "MutaTimer.h"
#include "MutaObject.h"
#include "QHash"
//#include "Mutagen.h"

class ContinuousSequencer : public QObject
{
    Q_OBJECT
public:
    ContinuousSequencer( QMainWindow* parent,float y);
    ~ContinuousSequencer();
    MutaGraphicsView* getView();
    MutaScene* getScene();
    void setY(int y);
    void setEditMode(Muta::MutaType editMode);
    MutaCursor* getCursor();
private:
    MutaCursor *cursor;
    MutaScene* scene;
    MutaGraphicsView* view;
    Muta::MutaType editMode;
    QVector<QGraphicsItem* > collidingItems;
    QComboBox layerButton;
    QTextEdit layerTextEdit;
    QList<MutaRepeat* > markers;
    QReadWriteLock collidingLock;
    bool lessThan(const MutaRepeat* object1,const MutaRepeat* object2);
    int markerNum;
    QMainWindow* w;
    float y;

signals:
    void editModeChanged(Muta::MutaType editMode);
    void attack(QString id,QString type,float val);
    void release(QString id,QString type,float val);
    void sustain(QString id,QString type,float val);

public slots:
    void mutaTimeEvent(qreal delta);
    void lineEditing();
    void eventEditing();
    void repeatEditing();
    void curveEditing();
    void tendrilEditing();
    void blendEditing();
    void strangeAttractorEditing();
    void textChanged();
    void removeCollidingItem(QString objectID);
    void stopAllNotes();
    void addRepeatMarker(MutaRepeat* repeat);
    void removeRepeatMarker(QObject* repeat);
    void incrementMarker();
    void decrementMarker();
    void windowResized();
    void startAllNotes();
};

#endif // CONTINUOUSSEQUENCER_H
